﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using DataLayer.Controller;

public partial class provider_DocSupport : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            grvDocumento.DataSource = DocSopController.GetByBillNumber(Request.Params["NoFactura"]);
            grvDocumento.DataBind();

        }
    }

    protected void grvDocumento_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            HyperLink hplDocumento = (HyperLink)e.Row.FindControl("hplDocumento");
            hplDocumento.NavigateUrl = ConfigurationManager.AppSettings["urlSoporte"].ToString() + DataBinder.Eval(e.Row.DataItem, "NUMERO_DOCUMENTO").ToString().Trim() + "_" + DateTime.Parse(DataBinder.Eval(e.Row.DataItem, "FECHA_FACTURA").ToString()).ToString("ddMMyyyy") + ".pdf";
        }
    }
}
